﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.WebApi
{
    public partial class Config
    {
        public class Module
        {
            public string Assembly { get; set; }
            public string Type { get; set; }
            public string Name { get; set; }

            //public List<Config.Action> Actions { get; set; }

            public Module()
            {
                //Actions = new List<Config.Action>();
            }

            public static Config.Module Build(Packaging.ModuleDef moduleDef)
            {
                Config.Module module = new Module();
                module.Name = moduleDef.Name;
                module.Assembly = moduleDef.Assembly;
                module.Type = moduleDef.Type;

                //foreach (Packaging.ActionDef actionDef in moduleDef.Actions)
                //{
                //    Config.Action action = new Action();
                //    action.Name = actionDef.Name;
                //    action.Scenario = actionDef.Scenario;
                //    action.Type = actionDef.Type;
                //    module.Actions.Add(action);
                //}

                return module;
            }
        }
    }
}
